import 'package:flutter/material.dart';
import 'package:flutter_hsh/pages/web_view/webview_logic.dart';
import 'package:flutter_hsh/widgets/my_app_bar.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class WebViewPage extends GetView<WebViewLogic> {
  const WebViewPage({super.key});


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: MyAppBar(
        centerTitle: controller.title ?? '',
        backgroundColor: Colors.white,
      ),
      body: SafeArea(
        child: Column(
          children: [
            Container(
              width: double.infinity,
              height: 8.w,
              color: const Color(0xFFF8F8F8),
            ),
            Expanded(
              child: InAppWebView(
                initialUrlRequest: URLRequest(
                  url: WebUri(controller.webUrl ?? ""),
                ),
                onWebViewCreated: (controller) {},
              ),
            )
          ],
        ),
      ),
    );
  }
}
